package org.jgs2007.onemall.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.jgs2007.onemall.entity.User;
import org.jgs2007.onemall.mapper.UserMapper;
import org.jgs2007.onemall.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public PageInfo<User> getAll(Integer pageNum, Integer pageSize) {

        // 使用分页插件分页
        PageHelper.startPage(pageNum, pageSize);

        return new PageInfo<>(userMapper.getAll());

    }
}
